package org.bookie.model.services;

import java.util.List;

import org.bookie.model.Bet;
import org.bookie.model.Category;
import org.bookie.model.Event;
import org.bookie.model.Period;
import org.bookie.model.services.impl.GenericDAO;

/**
 * DAO for {@link Event} instances
 * 
 * @author drobiazko
 * 
 */
public interface EventDAO extends GenericDAO<Event, Long> {

	/**
	 * Find all events by given category
	 * 
	 * @param id
	 * @return
	 */
	public List<Event> findByCategory(Long id);

	public List<Event> findByFilter(String filter);

	/**
	 * Returns the {@link Event}s with the earliest end date
	 * 
	 * @param max
	 *            the maximum number of results
	 * @return list of Events
	 */
	public List<Bet> findExpiring(int max);
	
	public List<Event> find(Period period, Category category);
	
	public void cancel(Long id);
}
